<%= link_to '添加图片', new_photo_path,:class=>"action_add",:style=>"float:right;" %>

<table class="admin">
  <thead>
    <tr>
      <th>编号</th>
      <th>广告图片</th>
      <th colspan="2">操作</th>
    </tr>
  </thead>
  <tbody>
    <% for @photo in @photos  %>
      <tr class="action_link">
        <td>
          <%=@photo.id%>
        </td>
        <td>
          <% if @photo.url %>
            <%= image_tag url_for_file_column(@photo, "url"),:class=>'photo_img' %>
          <%  end %>
        </td>
        <td>
          <%= link_to '编辑', [:edit,@photo],:class=>'action_edit' %>
        </td>
        <td>
          <%= link_to '删除',[@photo], :confirm => '确定删除?', :method => :delete,:class=>'action_delete' %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<div id="pager">
  <%= will_paginate @photos,:prev_label => '«上一页',:next_label => '下一页»' %>
</div>

<div class="action_link">
  <%= link_to '回首页', "/",:class=>'action_back' %>
</div>


